﻿using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Diagnostics;
using System.Linq;
using System.ServiceProcess;
using System.Text;
using System.Threading;
using System.Threading.Tasks;

namespace ServiceHoloXia
{
    public partial class Service1 : ServiceBase
    {
        private Thread threadIteration;
        public Service1()
        {
            InitializeComponent();
        }

        public Thread ThreadIteration
        {
            get
            {
                return threadIteration;
            }

            set
            {
                threadIteration = value;
            }
        }

        protected override void OnStart(string[] args)
        {
            ThreadIteration = new Thread(IterationThread.InstanceIterationThread.caller);
            ThreadIteration.Start();
            base.OnStart(args);
        }

        protected override void OnStop()
        {
            ThreadIteration.Abort();
            base.OnStop();
        }
    }
}
